package com.witmore.skyline.web.config;


import com.witmore.skyline.web.controller.vo.result.AccountSession;

/**
 * Description: GlobalAccountSession
 * Author: 豆子高
 * Date: 2025/3/20 17:29
 */
public class GlobalAccountSession {

    private static final ThreadLocal<AccountSession> THREAD_LOCAL_USER_INFO = new ThreadLocal<>();


    public static void setUserInfo(AccountSession userInfo) {
        THREAD_LOCAL_USER_INFO.set(userInfo);
    }

    public static AccountSession getUserInfo() {
        return THREAD_LOCAL_USER_INFO.get();
    }

    public static void removeUserInfo() {
        THREAD_LOCAL_USER_INFO.remove();
    }
}
